import re
from com.mtc.util.connector import Connector

bbs = Connector()
url = "http://www.mitbbs.com/article_t/Chongqing/2073.html"
unique = set()

while True:
  page_data = bbs.get_page(url)
  users = re.findall(r'/user_info/([a-zA-Z0-9]+)/[a-z0-9]+"', page_data)
  for user in users:
    unique.add(user)
    
  next_page = re.search(ur'<a href="(.+)" class="NEWS">\u00CF\u00C2\u00D2\u00B3', page_data)
  if next_page : 
    url = "http://www.mitbbs.com" + next_page.group(1)
  else :
    break

users = list(unique)
users.sort()
for user in users:
  print user


